<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //时间对象
        //只能用new来创建
        //设置月份记得-1
        var date = new Date()


        date.setFullYear('2025')
        date.setMonth('10')
        date.setHours('23')
        date.setMinutes('59')
        date.setSeconds('59')

        //获取年/月/日/小时/分钟/秒
        console.log(date.getFullYear())
        console.log(date.getMonth()+1)//官方定义月从0开始
        console.log(date.getDate())
        console.log(date.getHours())
        console.log(date.getMinutes())
        console.log(date.getSeconds())
        
        //获取时间戳
        //作为唯一标识
        //从1970年开始到现在的毫秒数
        //毫秒 24*60*60*1000
        console.log(date.getTime())
        
        // console.log(date.getDay())
        // console.log(date)
        
        
        
    </script>
</body>
</html>